<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <meta charset="utf-8"/>
    <title>天天生鲜－我的订单</title>
    <link rel="stylesheet" type="text/css" href="static/css/reset.css">
    <link rel="stylesheet" type="text/css" href="static/css/main.css">
    <link rel="stylesheet" type="text/css" href="static/css/order.css">
</head>
<body>

<!--头部  开始-->
<div class="header_con">
    <div class="header">
        <div class="welcome fl">欢迎来到天天生鲜!</div>
        <div class="fr">
            <div class="login_info fl" style="display: block">
                欢迎您：<em></em>
                <a href="login.jsp" class="zhuxiao">注销</a>
            </div>
            <div class="login_btn fl" style="display:none">
                <a href="login.jsp">登录</a>
                <span>|</span>
                <a href="register.jsp">注册</a>
            </div>

            <div class="user_link fl">
                <span>|</span>
                <a href="customer.html">用户中心</a>
                <span>|</span>
                <a href="shop.html">我的购物车</a>
                <span>|</span>
                <a href="${pageContext.request.contextPath}/orderList">我的订单</a>
            </div>
        </div>
    </div>
</div>
<!--头部  结束-->

<!--内容  开始-->
<div class="search_bar clearfix">
    <a href="index.html" class="logo fl"><img src="static/images/logo.png"></a>
    <div class="sub_page_name fl">|&nbsp;&nbsp;&nbsp;&nbsp;用户中心</div>
    <div class="search_con fr">
        <form method="get" action="http://ttsx.newzn.cn/search/" target="_blank">
            <input type="text" class="input_text fl" name="q" placeholder="搜索商品">
            <input type="submit" class="input_btn fr" value="搜索">
        </form>
    </div>
</div>
<div class="main_con clearfix">
    <div class="left_menu_con clearfix">
        <h3>用户中心</h3>
        <ul>
            <li><a href="customer.html">· 个人信息</a></li>
            <li><a href="${pageContext.request.contextPath}/orderList" class="active">· 全部订单</a></li>
            <li><a href="address.html">· 收货地址</a></li>
        </ul>
    </div>

    <div class="right_content clearfix">

        <h3 class="common_title2">全部订单</h3>

        <br>

        <table>
            <th width="5%">ID</th>
<%--            <th width="5%">总价</th>--%>
            <th width="20%">商品详情</th>
            <th width="10%">订单状态</th>
            <th width="10%">支付方式</th>
            <th width="10%">下单用户</th>
            <th width="10%">下单时间</th>
            <th width="10%">付款时间</th>
            <th width="10%">发货时间</th>
            <th width="10%">操作</th>

            <c:forEach var="orders" items="${pageInfo.list}">
                <tr>
                    <td>${orders.oid}</td>
                    <td>${orders.shoppingCart.goods.gname}(${orders.shoppingCart.goods.price}) * ${orders.shoppingCart.num}</td>
                    <td>
                        <c:if test="${orders.state==1}">未付款</c:if>
                        <c:if test="${orders.state==2}"><span style="color: red">已付款</span></c:if>
                        <c:if test="${orders.state==3}">配送中</c:if>
                        <c:if test="${orders.state==4}">已完成</c:if>
                    </td>
                    <td>111</td>
                    <td>${orders.shoppingCart.user.uname}</td>
                    <td><fmt:formatDate value="${orders.order}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                    <td><fmt:formatDate value="${orders.payment}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                    <td><fmt:formatDate value="${orders.delivery}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                    <td>删除</td>
                </tr>
            </c:forEach>
        </table>
    </div>

    <div style="clear: both;text-align: center">
        <ul style="list-style: none">
            <li><a href="${pageContext.request.contextPath}/orderList?pageNum=1">首页</a>&nbsp;</li>
            <c:if test="${pageInfo.hasPreviousPage}">
                <li>
                    <a href="${pageContext.request.contextPath}/orderList?pageNum=${pageInfo.pageNum-1}">
                    <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
            </c:if>
            <c:forEach items="${pageInfo.navigatepageNums}" var="page">
                <c:if test="${page==pageInfo.pageNum }">
                    <li ><a style="color:red" href="${pageContext.request.contextPath}/orderList?pageNum=${page}">${page}</a>&nbsp;&nbsp;</li>
                </c:if>
                <c:if test="${page!=pageInfo.pageNum }">
                    <li><a href="${pageContext.request.contextPath}/orderList?pageNum=${page}">${page}</a>&nbsp;&nbsp;</li>
                </c:if>
            </c:forEach>
            <c:if test="${pageInfo.hasNextPage }">
                <li>
                    <a href="${pageContext.request.contextPath}/orderList?pageNum=${pageInfo.pageNum+1 }" >
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            </c:if>

            <li><a href="${pageContext.request.contextPath}/orderList?pageNum=${pageInfo.pages}">末页</a></li>
        </ul>
    </div>
    <div style="clear: both;text-align: center">
        当前${pageInfo.pageNum }页，总共${pageInfo.pages }页，总共${pageInfo.total }条记录
    </div>
</div>
<!--内容  结束-->

</body>
</html>